feat: expose stable findingId and RemediationAgentQuickFix kind [IDE-2052]#1326
Draft
bastiandoetsch wants to merge 1 commit into
Draft
feat: expose stable findingId and RemediationAgentQuickFix kind [IDE-2052]#1326bastiandoetsch wants to merge 1 commit into
bastiandoetsch wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
1 task
PR Reviewer Guide 🔍
|
Contributor
Author
|
/describe |
|
PR Description updated to latest commit (8a1072b) |
3 tasks
Contributor
|
/describe |
4af253c to
c674073
Compare
|
PR Description updated to latest commit (c674073) |
c674073 to
4370e34
Compare
…052]
Add FindingId to ScanIssue (Diagnostic.data) sourced from issue.GetFindingId().
Unlike the existing Id field (per-result-set key), FindingId is stable across
separate scan invocations, enabling clients to correlate the same underlying
finding over time without relying on mutable string matching.
Add Kind (LSP CodeActionKind) to the CodeAction interface and domain struct.
The converter derives kind from action.GetKind(), falling back to QuickFix for
all existing actions (zero-value Kind field). Add RemediationAgentQuickFix
constant ("quickfix.snyk.remediationAgent") so clients can machine-match on
this kind rather than the localised action title.
IaC issues emit empty FindingId until the IaC scanner is updated to set it;
this gap is documented by a dedicated test.
4370e34 to
7c5801a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
FindingIdfield tosnyk.Issueandtypes.Issuewith stable cross-scan identifier (Fingerprints.SnykAssetFindingV1)RemediationAgentQuickFixLSP code action kind constant (quickfix.snyk.remediationAgent)FindingIdthrough Code/OSS/Secrets/IaC convertersGetFindingId()accessor to issue interfacePR Stack — Merge Order
flowchart LR main(["main"]) PR1["#? PR-1 ← YOU ARE HERE\nfindingId + kind"] PR2["#? PR-2\nCA provider"] PR3["#? PR-3\nremy initial"] PR4["#? PR-4\nworktree impl"] PR5["#? PR-5\nunit tests"] PR6["#? PR-6\ninteg+smoke tests"] main --> PR1 --> PR2 --> PR3 --> PR4 --> PR5 --> PR6 style PR1 fill:#ffd700,color:#000Deferred to later PRs
Test plan
make testpassesPR Type
Enhancement, Tests
Description
Add stable
FindingIdtoScanIssue.Introduce
RemediationAgentQuickFixLSP kind.Propagate
FindingIdthrough converters.Add tests for new
FindingIdandCodeActionKind.Diagram Walkthrough
flowchart LR A[Issue Interface] -- GetFindingId() --> B(ScanIssue); C[CodeAction Struct] -- GetKind() --> D(LSP CodeAction); B -- FindingId --> E(Client); D -- Kind --> F(Client); subgraph Domain/Types A C end subgraph Domain/Converter B D endFile Walkthrough
converter.go
Propagate FindingId and handle CodeAction Kinddomain/ide/converter/converter.go
ToCodeActionto correctly use theaction.GetKind()which cannow be
RemediationAgentQuickFix.types.QuickFixifaction.GetKind()istypes.Empty.FindingId: issue.GetFindingId()toScanIssuewhen convertingissues for OSS, IaC, Code, and Secrets products.
codeaction.go
Add Kind field to CodeAction structdomain/snyk/codeaction.go
Kindfield of typetypes.CodeActionKindto theCodeActionstruct.
GetKind()method to access the newKindfield.issues.go
Update CodeAction interface with GetKindinternal/types/issues.go
CodeActioninterface to include aGetKind()method,enabling access to the code action's kind.
lsp.go
Define RemediationAgentQuickFix and document FindingIdinternal/types/lsp.go
RemediationAgentQuickFixfor the LSPCodeActionKind.ScanIssue.FindingIdexplaining its purposeas a stable, cross-scan identifier.
converter_test.go
Test FindingId propagation and CodeAction Kinddomain/ide/converter/converter_test.go
ScanIssue.FindingIdpopulation forCode, OSS, Secrets, and IaC issues.
FindingId.CodeActionKindis correctly derived, includingthe new
RemediationAgentQuickFixand fallback logic.